﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TagManage.aspx.cs" Inherits="iEN.Organization.TagManage" MaintainScrollPositionOnPostback="true" EnableEventValidation="false"%>
<%@ Register src="../UserControl/TopMenu.ascx" tagname="TopMenu" tagprefix="uc2" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <center>
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    </div>
    <table  style="width: 952px">  
        <tr>
            <td><uc2:TopMenu ID="TopMenu1" runat="server" /></td>                
        </tr>
        <tr>
            <td style="background-image:url('../images/title_back.gif')" align="center" ; width="952px" >
                <asp:Label ID="Label1" runat="server" Text="監 控 點 管 理" BackColor="Transparent" Font-Names="標楷體" Font-Size="XX-Large" ForeColor="Blue"></asp:Label>
            </td>              
        </tr>
        <tr>
            <td>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate >
                    <tr>
                        <td align="center">
                        <asp:Label ID="lblMsg" runat="server" Font-Names="微軟正黑體" Font-Size="X-Large" 
                        ForeColor="Red" Text="你沒有瀏覽此頁面的權限" Visible="False"></asp:Label>
                        <asp:Panel ID="Panel2" runat="server" GroupingText="請選擇設備" BackColor="Transparent" 
                                Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" Font-Size="16px" ForeColor="Black" 
                                style="width: 952px" HorizontalAlign="Left">
                            <asp:Label ID="Label2" runat="server" ForeColor="Black" Text="控制器：" Font-Size="Medium"></asp:Label>
                            <asp:DropDownList ID="ddlControl" runat="server" AutoPostBack="True" 
                                CssClass="normal" Font-Size="Medium" onselectedindexchanged="ddlControl_SelectedIndexChanged">
                            </asp:DropDownList>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <asp:Label ID="Label3" runat="server" ForeColor="Black" Text="設備：" Font-Size="Medium"></asp:Label>
                            <asp:DropDownList ID="ddlDevice" runat="server" AutoPostBack="True" 
                                CssClass="normal" Font-Size="Medium" 
                                onselectedindexchanged="ddlDevice_SelectedIndexChanged">
                            </asp:DropDownList>
                        </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td align="center">
                            <asp:Panel ID="Panel1" runat="server" GroupingText="監控點列表" 
                                BackColor="Transparent" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" 
                                Font-Size="16px" ForeColor="Black" style="width: 952px" Visible="False">
                                <asp:GridView ID="gvGrpName" runat="server" CellPadding="4" EmptyDataText="尚未設定相關資料！" 
                                    ForeColor="#333333" AutoGenerateColumns="False"
                                    Width="900px" ondatabound="gvGrpName_DataBound" PageSize="50" 
                                    HorizontalAlign="Center" style="margin-top: 0px" 
                                    onrowdeleting="gvGrpName_RowDeleting" 
                                    onselectedindexchanging="gvGrpName_SelectedIndexChanging" 
                                    onrowdatabound="gvGrpName_RowDataBound">
                                <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White"/>
                                <RowStyle BackColor="#E3EAEB" Font-Size="Medium" />
                                <EmptyDataRowStyle CssClass="note" />
                                <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333"/>
                                <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" Font-Size="Medium" />
                                <EditRowStyle BackColor="PaleGoldenrod" />
                                <AlternatingRowStyle BackColor="White" />
                                <Columns>
                                    <asp:BoundField HeaderText="ID" ReadOnly="True" DataField="_id" SortExpression="_id">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="名稱" ReadOnly="True" DataField="_name" SortExpression="_name">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="顯示文字" ReadOnly="True" DataField="_label" 
                                        SortExpression="_label">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="說明" ReadOnly="True" DataField="_desc" 
                                        SortExpression="_desc">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="屬性" ReadOnly="True" DataField="_attribute" SortExpression="_attribute">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="單位" ReadOnly="True" DataField="_unit" SortExpression="_unit">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="比例值" ReadOnly="True" DataField="_weight" SortExpression="_weight">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:BoundField HeaderText="偏差值" ReadOnly="True" DataField="_bias" SortExpression="_bias">
                                        <HeaderStyle HorizontalAlign="Center" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" />
                                    </asp:BoundField>
                                    <asp:CommandField ButtonType="Button" EditText="修改" SelectText="修改" ShowSelectButton="True">
                                        <ItemStyle Width="50px" />
                                    </asp:CommandField>
                                    <asp:TemplateField ShowHeader="False">
                                        <ItemTemplate>
                                            <asp:Button ID="Button1" runat="server" CausesValidation="False" 
                                                CommandName="Delete" Text="刪除" OnClientClick="return confirm('是否刪除？');"/>
                                        </ItemTemplate>
                                        <ItemStyle Width="50px" />
                                    </asp:TemplateField>
                                </Columns>
                                <PagerTemplate>
                                    <asp:Label ID="lbAllCount" runat="server" Text="Label"></asp:Label>
                                    <asp:Button ID="First" runat="server" onclick="First_Click" Text="第一頁" CommandArgument="First" />
                                    <asp:Button ID="Previous" runat="server"  Text="前一頁" onclick="Previous_Click" CommandArgument="Previous" />
                                    <asp:Button ID="Next" runat="server"  Text="下一頁" onclick="Next_Click" CommandArgument="Next" />
                                    <asp:Button ID="Last" runat="server"  Text="最後頁" onclick="Last_Click" CommandArgument="Last" />
                                    <asp:DropDownList ID="dd1PageJump" runat="server" onselectedindexchanged="dd1PageJump_SelectedIndexChanged" AutoPostBack="True"></asp:DropDownList>
                                    <asp:Label ID="lbAllPage" runat="server" Text="Label"></asp:Label>
                                </PagerTemplate>
                            </asp:GridView>
                            </asp:Panel>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <asp:Button ID="btReturn" runat="server" Text="回設備管理" Font-Size="Medium" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif"
                                onclick="btReturn_Click"/>
                            <asp:Button ID="btAddTag" runat="server" Font-Size="Medium" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif"
                                onclick="btAddTag_Click" Text="新增" />
                        </td>
                    </tr>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <tr>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel2" runat="server" Visible="false">
                        <ContentTemplate>
                        <tr>
                        <td align="center">
                            <asp:Panel ID="Panel3" runat="server" GroupingText="修改監控點" BackColor="Transparent" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" Font-Size="16px" ForeColor="Black" style="width: 952px">
                                <table style="margin: 0px 0px 0px 5px; border:2px double gray">
                                    <tr>
                                        <td class="GrayTxtHeader">名&nbsp;&nbsp;&nbsp;&nbsp; 稱 : </td>
                                        <td align="left"><asp:TextBox ID="TagName" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">顯示文字 : </td>
                                        <td align="left"><asp:TextBox ID="tbShowText" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">標準名稱 : </td>
                                        <td align="left"><asp:DropDownList ID="StrName" runat="server" Width="150px">
                                            <asp:ListItem Value="-1">不指定</asp:ListItem>
                                            <asp:ListItem Value="1">用電度數</asp:ListItem>
                                            <asp:ListItem Value="2">平均需量</asp:ListItem>
                                            <asp:ListItem Value="3">有效功率</asp:ListItem>
                                            <asp:ListItem Value="4">功率因數</asp:ListItem>
                                            <asp:ListItem Value="5">連線狀態</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">屬&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 性 : </td>
                                        <td align="left"><asp:DropDownList ID="Attribute" runat="server" Width="150px">
                                            <asp:ListItem>AI</asp:ListItem>
                                            <asp:ListItem>AO</asp:ListItem>
                                            <asp:ListItem>DI</asp:ListItem>
                                            <asp:ListItem>DO</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">單&nbsp;&nbsp;&nbsp;&nbsp; 位 : </td>
                                        <td align="left"><asp:TextBox ID="tbUnit" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">比 例 值 : </td>
                                        <td align="left"><asp:TextBox ID="tbWeight" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">偏 差 值: </td>
                                        <td align="left"><asp:TextBox ID="tbBias" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">暫存記憶體型別 : </td>
                                        <td align="left"><asp:DropDownList ID="Resig" runat="server" Width="150px">
                                            <asp:ListItem>COILS</asp:ListItem>
                                            <asp:ListItem>DISCRETE_INPUT</asp:ListItem>
                                            <asp:ListItem>HOLDING_REGISTERS</asp:ListItem>
                                            <asp:ListItem>INPUT_REGISTERS</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">資料型別 : </td>
                                        <td align="left"><asp:DropDownList ID="DataType" runat="server" Width="150px">
                                            <asp:ListItem>INT</asp:ListItem>
                                            <asp:ListItem>FLOAT</asp:ListItem>
                                            <asp:ListItem>BCD</asp:ListItem>
                                            <asp:ListItem>BYTE</asp:ListItem>
                                            <asp:ListItem>BOOLEAN</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">資料長度 : </td>
                                        <td align="left"><asp:DropDownList ID="DataLong" runat="server" Width="150px">
                                            <asp:ListItem>WORD</asp:ListItem>
                                            <asp:ListItem>DWORD</asp:ListItem>
                                            <asp:ListItem>6WORD</asp:ListItem>
                                            <asp:ListItem>HI_B</asp:ListItem>
                                            <asp:ListItem>LO_B</asp:ListItem>
                                            <asp:ListItem>BIT</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">指定位元位址 : </td>
                                        <td align="left"><asp:TextBox ID="tbBitAddressUpdate" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">暫存器位址 : </td>
                                        <td align="left"><asp:TextBox ID="tbRegisterAddressUpdate" runat="server" 
                                                Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">高低位元互換 : </td>
                                        <td align="left"><asp:DropDownList ID="HigLow" runat="server" Width="150px">
                                            <asp:ListItem Value="0">否</asp:ListItem>
                                            <asp:ListItem Value="1">是</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">說&nbsp;&nbsp;&nbsp;&nbsp; 明 : </td>
                                        <td><asp:TextBox ID="DeviceDesc" runat="server" TextMode="MultiLine"></asp:TextBox></td>
                                    </tr> 
                                    <tr>
                                        <td align="center">
                                            <asp:Button ID="YesEdit" runat="server" Text="確定" onclick="YesEdit_Click" />
                                            <asp:Button ID="NoEdit" runat="server" Text="取消" onclick="NoEdit_Click" />
                                        </td>
                                    </tr>                             
                                </table>
                            </asp:Panel>
                        </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>

                <tr>
                    <td>
                        <asp:UpdatePanel ID="UpdatePanel3" runat="server" Visible="false">
                        <ContentTemplate>
                        <tr>
                        <td align="center">
                            <asp:Panel ID="Panel4" runat="server" GroupingText="新增監控點" BackColor="Transparent" Font-Names="微軟正黑體,新細明體,標楷體,Arial,sans-serif" Font-Size="16px" ForeColor="Black" style="width: 952px">
                                <table style="margin: 0px 0px 0px 5px; border:2px double gray">
                                    <tr>
                                        <td class="GrayTxtHeader">名&nbsp;&nbsp;&nbsp;&nbsp; 稱 : </td>
                                        <td align="left"><asp:TextBox ID="tbName" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">顯示文字 : </td>
                                        <td align="left"><asp:TextBox ID="tbShow" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">標準名稱 : </td>
                                        <td align="left"><asp:DropDownList ID="ddlStrName" runat="server" Width="150px">
                                            <asp:ListItem Value="-1">不指定</asp:ListItem>
                                            <asp:ListItem Value="1">用電度數</asp:ListItem>
                                            <asp:ListItem Value="2">平均需量</asp:ListItem>
                                            <asp:ListItem Value="3">有效功率</asp:ListItem>
                                            <asp:ListItem Value="4">功率因數</asp:ListItem>
                                            <asp:ListItem Value="5">連線狀態</asp:ListItem>
                                        </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">屬&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 性 : </td>
                                        <td align="left"><asp:DropDownList ID="ddlAttribute" runat="server" Width="150px">
                                            <asp:ListItem>AI</asp:ListItem>
                                            <asp:ListItem>AO</asp:ListItem>
                                            <asp:ListItem>DI</asp:ListItem>
                                            <asp:ListItem>DO</asp:ListItem>
                                        </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">單&nbsp;&nbsp;&nbsp;&nbsp; 位 : </td>
                                        <td align="left"><asp:TextBox ID="Unit" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">比 例 值 : </td>
                                        <td align="left"><asp:TextBox ID="Weight" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">偏 差 值: </td>
                                        <td align="left"><asp:TextBox ID="Bias" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">暫存記憶體型別 : </td>
                                        <td align="left"><asp:DropDownList ID="ddlR" runat="server" Width="150px">
                                            <asp:ListItem>COILS</asp:ListItem>
                                            <asp:ListItem>DISCRETE_INPUT</asp:ListItem>
                                            <asp:ListItem>HOLDING_REGISTERS</asp:ListItem>
                                            <asp:ListItem>INPUT_REGISTERS</asp:ListItem>
                                        </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">資料型別 : </td>
                                        <td align="left"><asp:DropDownList ID="ddlDataType" runat="server" Width="150px">
                                            <asp:ListItem>INT</asp:ListItem>
                                            <asp:ListItem>FLOAT</asp:ListItem>
                                            <asp:ListItem>BCD</asp:ListItem>
                                            <asp:ListItem>BYTE</asp:ListItem>
                                            <asp:ListItem>BOOLEAN</asp:ListItem>
                                        </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">資料長度 : </td>
                                        <td align="left"><asp:DropDownList ID="ddlDataLong" runat="server" Width="150px">
                                            <asp:ListItem>WORD</asp:ListItem>
                                            <asp:ListItem>DWORD</asp:ListItem>
                                            <asp:ListItem>6WORD</asp:ListItem>
                                            <asp:ListItem>HI_B</asp:ListItem>
                                            <asp:ListItem>LO_B</asp:ListItem>
                                            <asp:ListItem>BIT</asp:ListItem>
                                        </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">指定位元位址 : </td>
                                        <td align="left"><asp:TextBox ID="tbBitAddressAdd" runat="server" Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">暫存器位址 : </td>
                                        <td align="left"><asp:TextBox ID="tbRegisterAddressAdd" runat="server" 
                                                Width="150px"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">高低位元互換 : </td>
                                        <td align="left"><asp:DropDownList ID="ddlHL" runat="server" Width="150px">
                                            <asp:ListItem Value="0">否</asp:ListItem>
                                            <asp:ListItem Value="1">是</asp:ListItem>
                                            </asp:DropDownList></td>
                                    </tr>
                                    <tr>
                                        <td class="GrayTxtHeader">說&nbsp;&nbsp;&nbsp;&nbsp; 明 : </td>
                                        <td><asp:TextBox ID="Des" runat="server" TextMode="MultiLine"></asp:TextBox></td>
                                    </tr> 
                                    <tr>
                                        <td align="center">
                                            <asp:Button ID="YesAdd" runat="server" Text="確定" onclick="YesAdd_Click" />
                                            <asp:Button ID="NoAdd" runat="server" Text="取消" onclick="NoAdd_Click" />
                                        </td>
                                    </tr>                             
                                </table>
                            </asp:Panel>
                        </ContentTemplate>
                        </asp:UpdatePanel>
                    </td>
                </tr>
            </td>
        </tr>
    </table>
    </center>
    </form>
</body>
</html>
